<template>
  <div class="container">
    <a-form-model :model="form" ref="form" v-bind="layout"  >
      <a-form-model-item label="名称" prop="name">
        <a-input v-model="form.name" placeholder="名称" />
      </a-form-model-item>
      <a-form-model-item label="团支部书记" prop="secretary">
        <a-input v-model="form.secretary" placeholder="团支部书记" />
      </a-form-model-item>


      <a-form-model-item label="团支部副书记" prop="viceSecretary">
        <a-input  v-model="form.viceSecretary" placeholder="团支部副书记" />
      </a-form-model-item>

        <a-form-model-item label="组织委员" prop="organization">
        <a-input  v-model="form.organization" placeholder="组织委员" />
      </a-form-model-item>

        <a-form-model-item label="宣传委员" prop="publicity">
        <a-input  v-model="form.publicity" placeholder="宣传委员" />
      </a-form-model-item>
<!-- 
      <a-form-model-item label="发生时间" prop="birthday">
        <a-date-picker style="width:100%" v-model="form.happenTime" format="YYYY-MM-DD" valueFormat="YYYY-MM-DD 00:00:00" placeholder="发生时间" />
      </a-form-model-item> -->
    </a-form-model>
  </div>
</template>

<script>
export default {
  props: {
    form: {
      type: Object,
      default: () => {
        return {}
      },
    }
  },
  data() {
    return {
      layout: {
        labelCol: { span: 6 },
        wrapperCol: { span: 17 },
      },
      listData:[],
    }
  },
  mounted() {
    // if (this.$route.query.id) {
    //   this.form = this.$route.query 
    // }
    this.getList()
  },
  methods: {
    init(){
      this.form = this.$options.data().form;
      this.getList()
    },
    getList(){
     this.$ajax({
        url: this.$api.member.findList,
        data: {},
        success: (result) => {
          this.listData = result
        },
        fail: (err) => {
          this.$message.success(err);
        }
      });
    },
    save(e) {
      this.form.upId = e
      this.$ajax({
        url: this.$api.organization.saveOrUpdate,
        data: this.form,
        success: (result) => {
          this.$message.success("操作成功");
          this.$emit('pass', null);
          // this.$router.push(`/member/list`);
        },
        fail: (err) => {
          this.$message.success(err);
          this.$emit('reject', null);
        }
      });
    },
  }
}
</script>

<style lang="less" scoped>
  .container{
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
     padding: 8px 108px!important;
    .header{
      height: 56px;
      flex-grow: 0;
      display: flex;
      align-items: center;
      font-size: 1.8rem;
      padding-left: 2.4rem;
    }
    .content{
      height: auto;
      padding: 3.2rem 13.2rem;
      border-top: .1rem solid rgba(0, 0, 0, 0.1);;
      border-bottom: .1rem solid rgba(0, 0, 0, 0.1);;
    }
    .footer{
      height: 64px;
      flex-grow: 0;
      display: flex;
      align-items: center;
      justify-content: flex-end;
      padding-right: 2.4rem;
      .ant-btn {
        margin-left: 1.6rem;
      }
    }

   
  }
</style>
